package com.ruoyi.quartz.dao.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.ruoyi.quartz.dao.BaseJobDao;
import com.ruoyi.quartz.domain.JobInfoConfig;
import com.ruoyi.quartz.domain.JobLogDTO;
import com.ruoyi.quartz.mapper.JobInfoConfigMapper;

@Component
public class BaseJobDaoImpl implements BaseJobDao{

	@Autowired
	private JobInfoConfigMapper configMapper;
	
	@Override
	public void updateJobConfigById(Map<String, Object> updateMap) {
		configMapper.updateJobConfigById(updateMap);
	}

	@Override
	public String checkInstanceConfig(Map<String, String> paramMap) {
		return configMapper.checkInstanceConfig(paramMap);
	}

	@Override
	public List<JobInfoConfig> getJobConfig(Map<String, String> paramMap) {
		return configMapper.getJobConfig(paramMap);
	}

	@Override
	public Long lockJobConfig(String jobName) {
		return configMapper.lockJobConfig(jobName);
	}

	@Override
	public void updateJobLogByIdlogDTO(JobLogDTO logDTO) {
		configMapper.updateJobLogByIdlogDTO(logDTO);
	}

	@Override
	public Long insertJobLog(JobLogDTO logDTO) {
		return configMapper.insertJobLog(logDTO);
	}

	@Override
	public String getCronTime(Map<String, String> params) {
		return configMapper.getCronTime(params);
	}

	@Override
	public int updateJobRunningStatus(Map<String, String> paramMap) {
		return configMapper.updateJobRunningStatus(paramMap);
	}

	@Override
	public Boolean judgePreviousJobStatus(String jobName) {
		Boolean flag = configMapper.judgePreviousJobStatus(jobName);
		if (flag == null) {
			return false;
		}
		return flag;
	}

	@Override
	public Long getJobLimitOne(Map<String, Object> updateMap) {
		return configMapper.getJobLimitOne(updateMap);
	}

	@Override
	public List<JobInfoConfig> selectJobList(JobInfoConfig job) {
		return configMapper.selectJobList(job);
	}

}
